import 'package:mziot/app/data/comment_list_entity.dart';
import 'package:mziot/generated/json/base/json_convert_content.dart';

CommentListEntity $CommentListEntityFromJson(Map<String, dynamic> json) {
  final CommentListEntity commentListEntity = CommentListEntity();
  final List<CommentListList>? list = jsonConvert.convertListNotNull<CommentListList>(json['list']);
  if (list != null) {
    commentListEntity.list = list;
  }
  final bool? hasNext = jsonConvert.convert<bool>(json['hasNext']);
  if (hasNext != null) {
    commentListEntity.hasNext = hasNext;
  }
  return commentListEntity;
}

Map<String, dynamic> $CommentListEntityToJson(CommentListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['list'] = entity.list?.map((v) => v.toJson()).toList();
  data['hasNext'] = entity.hasNext;
  return data;
}

CommentListList $CommentListListFromJson(Map<String, dynamic> json) {
  final CommentListList commentListList = CommentListList();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    commentListList.id = id;
  }
  final String? headImg = jsonConvert.convert<String>(json['headImg']);
  if (headImg != null) {
    commentListList.headImg = headImg;
  }
  final String? nickname = jsonConvert.convert<String>(json['nickname']);
  if (nickname != null) {
    commentListList.nickname = nickname;
  }
  final String? content = jsonConvert.convert<String>(json['content']);
  if (content != null) {
    commentListList.content = content;
  }
  final String? commentDate = jsonConvert.convert<String>(json['commentDate']);
  if (commentDate != null) {
    commentListList.commentDate = commentDate;
  }
  return commentListList;
}

Map<String, dynamic> $CommentListListToJson(CommentListList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['headImg'] = entity.headImg;
  data['nickname'] = entity.nickname;
  data['content'] = entity.content;
  data['commentDate'] = entity.commentDate;
  return data;
}
